package com.cfs.chat;

import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @Description: Description
 * @Author: fengwei-lhq
 * @Date: 2024-11-27 17:21
 **/
@Log4j2
@EnableScheduling
@SpringBootApplication
public class ChatApplication {

    public static void main(String[] args) throws UnknownHostException {
        // SpringApplication.run(ChatApplication.class);
        ConfigurableApplicationContext application= SpringApplication.run(ChatApplication.class, args);
        Environment env = application.getEnvironment();
        log.info("\n[----------------------------------------------------------]\n\t" +
                        "聊天室启动成功！点击进入:\thttp://{}:{}" +
                        "\n[----------------------------------------------------------",
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port"));
    }
}
